package app

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"testPaper/common"
	"testPaper/model"
	"testPaper/response"
)

// QueryNewTestPaper 历年真题查询
func QueryNewTestPaper(c *gin.Context) {
	DB := common.GetDB()
	paperId := c.PostForm("paperId")

	var newTestPaper model.NewTestPaper
	DB.Where("paper_id = ?", paperId).First(&newTestPaper)
	response.Reponse(c, http.StatusOK, 200, gin.H{
		"data": newTestPaper,
	}, "获取成功")
	return
}
